import { createSlice } from "@reduxjs/toolkit";

const cartSlice = createSlice({
  name: "cart",

  initialState: {
    count: 0,
    msg: "hello",
  },

  reducers: {
    addCount(state) {
      state.count++;
    },
    changeMsg(state, action) {
      state.msg = action.payload;
    },
  },
});

export const { reducer } = cartSlice;

export const { addCount, changeMsg } = cartSlice.actions;
